//package xyz.erupt.flow.controller;
//
//import lombok.var;
//import org.springframework.web.bind.annotation.*;
//import xyz.erupt.core.annotation.EruptRouter;
//import xyz.erupt.core.constant.EruptRestPath;
//import xyz.erupt.core.exception.EruptApiErrorTip;
//import xyz.erupt.core.view.EruptApiModel;
//import xyz.erupt.flow.constant.FlowConstant;
//import xyz.erupt.flow.service.EruptPrintService;
//
//import javax.annotation.Resource;
//import java.io.UnsupportedEncodingException;
//import java.net.URI;
//import java.net.URISyntaxException;
//import java.net.URLDecoder;
//
///**
// * @author PP
// * @version 1.0
// * @project erupt-flow
// * @description 打印管理
// * @date 2024/10/12 16:37:30
// */
//@RestController
//@RequestMapping(EruptRestPath.ERUPT_API + "/" + FlowConstant.SERVER_NAME)
//public class EruptPrintController {
//    @Resource
//    private EruptPrintService eruptPrintService;
//
//    @PostMapping("/task/print/save/{taskId}/{guid}")
//    @EruptRouter(verifyType = EruptRouter.VerifyType.LOGIN)
//    public EruptApiModel SavePrintTask(@PathVariable("taskId") Long taskId ,@PathVariable("guid") String guid, @RequestBody String form_html) {
//        //解码
//        var data = "";
//        try {
//            data = URLDecoder.decode(URLDecoder.decode(form_html,"UTF-8"), "UTF-8");//解码两次
//        } catch (UnsupportedEncodingException e) {
//            throw new EruptApiErrorTip(e.getMessage());
//        }
//        eruptPrintService.SaveByTaskId(taskId,guid,data);
//        return EruptApiModel.successApi();
//    }
//
//
//
//    @PostMapping("/inst/print/save/{instId}/{guid}")
//    @EruptRouter(verifyType = EruptRouter.VerifyType.LOGIN)
//    public EruptApiModel SavePrintInst(@PathVariable("instId") Long instId , @PathVariable("guid") String guid,@RequestBody String form_html) {
//        //解码
//        var data = "";
//        try {
//            data = URLDecoder.decode(URLDecoder.decode(form_html,"UTF-8"), "UTF-8");//解码两次
//        } catch (UnsupportedEncodingException e) {
//            throw new EruptApiErrorTip(e.getMessage());
//        }
//        eruptPrintService.SaveByInstId(instId,guid,data);
//        return EruptApiModel.successApi();
//    }
//
//    @GetMapping("findFlowPrint/{guid}")
//    public EruptApiModel findFlowPrint(@PathVariable("guid") String guid) {
//        try{
//            var form = eruptPrintService.getEruptPrint(guid).getForm();
//            return EruptApiModel.successApi(form);
//        }catch (Exception e){
//            return EruptApiModel.errorApi("该流程尚未归档");
//        }
//
//    }
//}
